package com.sykj.why.mongo.enums;

/**
 * @author Eleven
 * @date 2019/6/18
 * @desc Solr类型枚举
 */

public class SolrEnum {

    public  enum Document{
        HERITAGE("非遗库",0),
        HERITAGE_MUSEUM("非遗博物馆",1),
        HERITAGE_FOLKWAYS("非遗民俗",2)

        ;
        private String name;
        private int state;

        public String getName() {
            return name;
        }

        public int getState() {
            return state;
        }

        Document(String name, int state) {
            this.name = name;
            this.state = state;
        }

        public static String getName(int tag) {
            for (SolrEnum.Document s : SolrEnum.Document.values()) {
                if (tag == s.getState()) {
                    return s.getName();
                }
            }
            return "";
        }
    }

}
